package model.forview;

import java.util.Iterator;
import java.util.Map;

import controllers.routes;

public class RecoveryModelForView extends ContentForMainTemplate
{
    private String email;
    private String statusMessage;
    
    public RecoveryModelForView()
    {
	//TODO
	String title = "Восстановление пароля";
	String userName = "";
	String header = "Восстановление пароля";
	String footer = "Восстановление пароля";
	this.statusMessage = "";
	mainModelForView = new MainModelForView(title, userName, header, footer);
    }
    
    public RecoveryModelForView(Map<String, String> form)
    {
	String title = "Восстановление пароля";
	String userName = "";
	String header = "Форма Восстановления пароля";
	String footer = "Восстановление пароля";
	setAttributesFromData(form);
	mainModelForView = new MainModelForView(title, userName, header, footer);
    }
    
    private void setAttributesFromData(Map<String, String> form)
    {
	Iterator<String> keys = form.keySet().iterator();
	while(keys.hasNext())
	{
	    String key = keys.next();
	    if(key.equals("data[email]"))
		this.email = form.get(key);
	}
    }
    
    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public String getStatusMessage()
    {
        return statusMessage;
    }

    public void setStatusMessage(String statusMEssage)
    {
        this.statusMessage = statusMEssage;
    }
}
